﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
using System.Drawing;

using Elegant.Ui;

namespace iPdf
{
    class TransparentPanel: System.Windows.Forms.Panel
    {
        public TransparentPanel()
        {
            SetStyle(ControlStyles.SupportsTransparentBackColor, true);
            BackColor = Color.Transparent;
        }

        ///<summary>
        ///Paints the background of the control.
        ///</summary>
        ///
        ///<param name="e">A <see cref="T:System.Windows.Forms.PaintEventArgs"></see> that contains the event data.</param>
        protected override void OnPaintBackground(PaintEventArgs e)
        {
            TextureGlyph glyph = SkinManager.GetGlyph("PopupMenu.Normal.Background") as TextureGlyph;

            if (glyph == null)
                return;

            glyph.Render(this, e.Graphics, ClientRectangle);
        }
    }
}
